package com.cheers.dao;

import java.util.Date;
import java.util.List;

import com.cheers.model.LuckEvent;
import com.cheers.mvo.LuckEventJoinUser;
import com.cheers.mvo.LuckEventLog;
import com.cheers.mvo.MyCode;
import com.cheers.mvo.Winner;


public interface LuckEventDao extends BaseDao {
	
	/**
	 * 获取活动参加人
	 * @param eventId
	 * @param winnerId
	 * @return
	 * @throws Exception
	 */
	public List<String> getEventJoinUser(String eventId, String winnerId) throws Exception;
	
	/**
	 * 获取活动推荐
	 * @return
	 * @throws Exception
	 */
	public List<LuckEvent> recd() throws Exception;
	
	/**
	 * 活动详情
	 * @param cgyId
	 * @param phase
	 * @return
	 * @throws Exception
	 */
	public LuckEvent load(String cgyId, int phase) throws Exception;
	
	/**
	 * 获取接近幸运码的幸运码
	 * @param luckId
	 * @param code
	 * @param type
	 * @return
	 * @throws Exception
	 */
	public Object[] getNear(String luckId, int code, int type) throws Exception;
	
	/**
	 * 获取100条兑换幸运活动记录时间
	 * @return
	 * @throws Exception
	 */
	public List<Date> listExchangeLog() throws Exception;
	
	/**
	 * 获取100条幸运活动
	 * @return
	 * @throws Exception
	 */
	public List<Date> listLuckEvent() throws Exception;
	
	/**
	 * 获取幸运列表
	 * @param firstIndex
	 * @param pageSize
	 * @return
	 * @throws Exception
	 */
	public List<LuckEvent> list(int firstIndex, int pageSize) throws Exception;
	
	/**
	 * 获取往期幸运列表
	 * @param firstIndex
	 * @param pageSize
	 * @return
	 * @throws Exception
	 */
	public List<LuckEvent> phaseList(int firstIndex, int pageSize) throws Exception;
	
	/**
	 * 活动期数列表
	 * @param cgyId
	 * @param firstIndex
	 * @param pageSize
	 * @return
	 * @throws Exception
	 */
	public List<LuckEvent> phaseList(String cgyId, int firstIndex, int pageSize) throws Exception;
	
	/**
	 * 活动期数
	 * @param cgyId
	 * @return
	 * @throws Exception
	 */
	public String phaseNum(String cgyId) throws Exception;
	
	/**
	 * 活动获奖者
	 * @param luckId
	 * @return
	 * @throws Exception
	 */
	public Winner winner(String luckId) throws Exception;
	
	/**
	 * 获奖者列表
	 * @param firstIndex
	 * @param pageSize
	 * @return
	 * @throws Exception
	 */
	public List<Winner> winnerList(int firstIndex, int pageSize) throws Exception;
	
	/**
	 * 我的幸运码
	 * @param userId
	 * @param firstIndex
	 * @param pageSize
	 * @return
	 * @throws Exception
	 */
	public List<MyCode> codeList(String userId, int firstIndex, int pageSize) throws Exception;
	
	/**
	 * 获取兑换记录列表
	 * @param userId
	 * @param firstIndex
	 * @param pageSize
	 * @return
	 * @throws Exception
	 */
	public List<LuckEventLog> exchangeList(String userId, int firstIndex, int pageSize) throws Exception;
	
	/**
	 * 该期活动我的兑换列表
	 * @param userId
	 * @param cgyId
	 * @param phase
	 * @param firstIndex
	 * @param pageSize
	 * @return
	 * @throws Exception
	 */
	public List<LuckEventLog> find(String userId, String cgyId, int phase, int firstIndex, int pageSize) throws Exception;
	
	/**
	 * 获取幸运活动参加者列表
	 * @param luckId
	 * @param firstIndex
	 * @param pageSize
	 * @return
	 * @throws Exception
	 */
	public List<LuckEventJoinUser> joinListById(String luckId, int firstIndex, int pageSize) throws Exception;
	
}
